<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
if($_RQ['op']=='get'){
	//显示系统当前版本信息
	if(!$_RQ['name']){
		exi('请选择应用！','error','goback');
	}
	$app=pdo_get('core_plugins',array('name'=>$_RQ['name']),array('release','version'));
	$app=$app['version'];
	$app['release']=date('Y/m/d H:i:s',$app['release']);
	$return['item']=$app?$app:array();
	$dat = cloud_request('update.plugin.versions',array('name'=>$_RQ['name']));
	$return['versions']=$dat['versions'];
	if($return['versions']){
		foreach($return['versions'] as &$item){
			$item['description'] = cfc('tools')->substr($item['description'],0,81);
			$item['release'] = date('Ymd',$item['release']);
			$item['title'] = '['.$item['version'].'-'.$item['release'].'更新]-'.$item['description'];
		}
	}
	$return['htmls'][]=array(
		'type'=>'look',
		'desc'=>'版本信息',
		'look'=>array(
			array('type'=>'tip','title'=>'[<red>温馨提示</red>]：如果长时间没有反应，更新异常，更新失败等；请<red>删除更新缓存</red>，或移步教程：<a href="http://s.jinyunweb.com/manage/index.php?p=core&action=article.show&nosession=1&id=412" target="_blank">更新异常排查教程</a>'),
			array('type'=>'string','name'=>'version','title'=>'应用当前版本'),
			array('type'=>'string','name'=>'release','title'=>'版本更新日期'),
		),
	);
	$return['htmls'][]=array(
		'type'=>'notice',
		'desc'=>'更新日志',
		'list'=>'versions',
	);
	exi($return);
}
?>